<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:include href="navegacion.xsl" />
	<xsl:include href="busqueda.xsl" />
	<xsl:include href="secciones.xsl" />
	<xsl:include href="controles.xsl" />
	
	<xsl:template match='/'>
		<html>
		<head>
			<link href="estilo/e-comerciales.css" rel="stylesheet" type="text/css" id="estilo"></link>
			<title>Listado de <xsl:value-of select="//@Titulo" /></title>
		</head>
		
			<body>
				<xsl:call-template name="logo" />
				<xsl:call-template name="membrete" />
				<xsl:call-template name="divisor-horizontal" />
				<xsl:apply-templates />					
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="Consulta" name="consultas">
		<div id="contenido" align="center">
		<div id="titulo">Listado de <xsl:value-of select="//@Titulo"></xsl:value-of></div>
		<xsl:call-template name="busqueda" />
		<link href="estilo/e-comerciales.css" rel="stylesheet" type="text/css"></link>
		<div id="listado-valores">
		<table class="tabla-contenido">
			<tr>
				<xsl:for-each select="//Estructura/Campo">
					<xsl:if test="@Oculto-Listado='0'">
						<th class="encabezado-tabla">
							<xsl:value-of select="@Alias"></xsl:value-of>
							<xsl:if test="string-length(@Alias)=0">
								<xsl:value-of select="@Nombre"></xsl:value-of>
							</xsl:if>
						</th>
					</xsl:if>
				</xsl:for-each>
				<th class="encabezado-tabla">Fecha Pago</th>
				<th class="encabezado-tabla">Pagar</th>
			</tr>

			<xsl:for-each select="//Fila">
			<tr class="fila-contenido">
			<form>
			<xsl:attribute name="action">Cobranzas.php</xsl:attribute>
			<xsl:attribute name="method">post</xsl:attribute>
			<input>
				<xsl:attribute name="type">hidden</xsl:attribute>
				<xsl:attribute name="id">0</xsl:attribute>
				<xsl:attribute name="value"><xsl:value-of select="Columna[@Id=0]/Valor"></xsl:value-of></xsl:attribute>
			</input>
			<xsl:for-each select="Columna">
				<xsl:if test="//Estructura/Campo[@Id=current()/@Id]/@Oculto-Listado=0">
					<td align="center">
						<xsl:value-of select="Valor"></xsl:value-of>
						<xsl:if test="string-length(Valor) = 0">
							---
						</xsl:if>
					</td>
				</xsl:if>
			</xsl:for-each>	
			<!--<td>
			<a>
				<xsl:attribute name="href">
					<xsl:value-of select="concat(//Consulta/@Nombre,'.php?modificar=', @Id, string('&amp;'), 'sel=', //Consulta/@Nombre)"></xsl:value-of>
				</xsl:attribute>
        	    Pagar
		    </a>
			</td>-->
			<td>
			<link href="Scripts/calendario.css" type="text/css" rel="stylesheet" />
			<script type="text/javascript" src="Scripts/calendario.js"></script>
			<input >
				<xsl:attribute name="type">text</xsl:attribute>
				<xsl:attribute name="size">10</xsl:attribute>
				<xsl:attribute name="name"><xsl:value-of select="concat(current()/Columna[@Id=0]/Valor, '_12')" /></xsl:attribute>
				<xsl:attribute name="Id">12</xsl:attribute>
				<xsl:attribute name="readonly">true</xsl:attribute>
			</input>
			<input>
				<xsl:attribute name="type">button</xsl:attribute>
				<xsl:attribute name="value">...</xsl:attribute>
				<xsl:attribute name="name">btn12</xsl:attribute>
				<xsl:attribute name="onclick">displayDatePicker('<xsl:value-of select="concat(current()/Columna[@Id=0]/Valor, '_12')" />');</xsl:attribute>
			</input>
			</td>
			<td>
			<input type="submit" value="Pagar" />
			</td>
			<input type="hidden" name= "op" >
					<xsl:attribute name="value">modificar</xsl:attribute>
			</input>
			<input type="hidden" name= "sel" >
				<xsl:attribute name="value"><xsl:value-of select="//Consulta/@Nombre"></xsl:value-of></xsl:attribute>
			</input>
			</form>
			</tr>
			</xsl:for-each>
		</table>
		</div>
		</div>
	</xsl:template>
		
</xsl:stylesheet>